const gchar *name);
static void move_to_current_desktop (GdkSurface *surface);
-#define SURFACE_IS_TOPLEVEL(surface) \
- (GDK_SURFACE_TYPE (surface) == GDK_SURFACE_TOPLEVEL || \
- GDK_SURFACE_TYPE (surface) == GDK_SURFACE_TEMP)
-
/* Return whether time1 is considered later than time2 as far as xserver
* time is concerned. Accounts for wraparound.
*/
g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
- if (!SURFACE_IS_TOPLEVEL (surface))
- return NULL;
-
impl = GDK_X11_SURFACE (surface);
if (!impl->toplevel)
void
gdk_x11_surface_pre_damage (GdkSurface *surface)
{
- GdkSurface *toplevel_surface = surface;
GdkX11Surface *impl;
- if (!toplevel_surface || !SURFACE_IS_TOPLEVEL (toplevel_surface))
- return;
-
- impl = GDK_X11_SURFACE (toplevel_surface);
+ impl = GDK_X11_SURFACE (surface);
if (impl->toplevel->in_frame &&
impl->toplevel->current_counter_value % 2 == 0)
gint64 presentation_time;
gint64 refresh_interval;
- if (!SURFACE_IS_TOPLEVEL (surface))
- return;
-
clock = gdk_surface_get_frame_clock (surface);
timings = gdk_frame_clock_get_current_timings (clock);
impl = GDK_X11_SURFACE (surface);
- if (!SURFACE_IS_TOPLEVEL (surface) ||
- impl->toplevel->extended_update_counter == None)
+ if (impl->toplevel->extended_update_counter == None)
return;
impl->toplevel->in_frame = TRUE;
impl = GDK_X11_SURFACE (surface);
- if (!SURFACE_IS_TOPLEVEL (surface) ||
- impl->toplevel->extended_update_counter == None ||
+ if (impl->toplevel->extended_update_counter == None ||
!impl->toplevel->in_frame)
return;
impl = GDK_X11_SURFACE (object);
- if (SURFACE_IS_TOPLEVEL (impl) && impl->toplevel->in_frame)
+ if (impl->toplevel->in_frame)
unhook_surface_changed (GDK_SURFACE (impl));
_gdk_x11_surface_grab_check_destroy (GDK_SURFACE (impl));
GdkX11Surface *impl;
impl = GDK_X11_SURFACE (surface);
- if (SURFACE_IS_TOPLEVEL (surface) && !impl->frame_clock_connected)
+ if (!impl->frame_clock_connected)
{
GdkFrameClock *frame_clock = gdk_surface_get_frame_clock (surface);
display_x11 = GDK_X11_DISPLAY (display);
x11_screen = GDK_X11_SCREEN (display_x11->screen);
- if (parent)
- xparent = GDK_SURFACE_XID (parent);
- else
- xparent = GDK_SCREEN_XROOTWIN (x11_screen);
+ xparent = GDK_SCREEN_XROOTWIN (x11_screen);
frame_clock = _gdk_frame_clock_idle_new ();
g_object_ref (surface);
_gdk_x11_display_add_window (x11_screen->display, &impl->xid, surface);
- switch (GDK_SURFACE_TYPE (surface))
- {
- case GDK_SURFACE_TOPLEVEL:
- case GDK_SURFACE_TEMP:
- gdk_surface_set_title (surface, get_default_title ());
-
- class_hint = XAllocClassHint ();
- class_hint->res_name = (char *) g_get_prgname ();
- class_hint->res_class = (char *) display_x11->program_class;
- XSetClassHint (xdisplay, impl->xid, class_hint);
- XFree (class_hint);
+ gdk_surface_set_title (surface, get_default_title ());
- setup_toplevel_window (surface, x11_screen);
- break;
+ class_hint = XAllocClassHint ();
+ class_hint->res_name = (char *) g_get_prgname ();
+ class_hint->res_class = (char *) display_x11->program_class;
+ XSetClassHint (xdisplay, impl->xid, class_hint);
+ XFree (class_hint);
- default:
- break;
- }
+ setup_toplevel_window (surface, x11_screen);
gdk_x11_event_source_select_events ((GdkEventSource *) display_x11->event_source,
GDK_SURFACE_XID (surface), GDK_ALL_EVENTS_MASK,
if (!already_mapped)
set_initial_hints (surface);
- if (SURFACE_IS_TOPLEVEL (surface))
- {
- display = gdk_surface_get_display (surface);
- display_x11 = GDK_X11_DISPLAY (display);
- toplevel = _gdk_x11_surface_get_toplevel (surface);
+ display = gdk_surface_get_display (surface);
+ display_x11 = GDK_X11_DISPLAY (display);
+ toplevel = _gdk_x11_surface_get_toplevel (surface);
- if (toplevel->user_time != 0 &&
- display_x11->user_time != 0 &&
- XSERVER_TIME_IS_LATER (display_x11->user_time, toplevel->user_time))
- gdk_x11_surface_set_user_time (surface, display_x11->user_time);
- }
+ if (toplevel->user_time != 0 &&
+ display_x11->user_time != 0 &&
+ XSERVER_TIME_IS_LATER (display_x11->user_time, toplevel->user_time))
+ gdk_x11_surface_set_user_time (surface, display_x11->user_time);
XMapWindow (xdisplay, xwindow);
_gdk_x11_surface_grab_check_unmap (surface,
NextRequest (GDK_SURFACE_XDISPLAY (surface)));
- /* You can't simply unmap toplevel surfaces. */
- switch (surface->surface_type)
- {
- case GDK_SURFACE_TOPLEVEL:
- case GDK_SURFACE_TEMP: /* ? */
- gdk_x11_surface_withdraw (surface);
- return;
-
- default:
- break;
- }
-
- _gdk_surface_clear_update_area (surface);
-
- XUnmapWindow (GDK_SURFACE_XDISPLAY (surface),
- GDK_SURFACE_XID (surface));
+ gdk_x11_surface_withdraw (surface);
}
static inline void
g_return_if_fail (GDK_IS_SURFACE (surface));
- if (GDK_SURFACE_DESTROYED (surface) ||
- !SURFACE_IS_TOPLEVEL (surface))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
display = GDK_SURFACE_DISPLAY (surface);
GdkDisplay *display;
Atom atom;
- if (GDK_SURFACE_DESTROYED (surface) ||
- !SURFACE_IS_TOPLEVEL (surface))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
display = gdk_surface_get_display (surface);
g_return_val_if_fail (GDK_IS_SURFACE (surface), GDK_SURFACE_TYPE_HINT_NORMAL);
- if (GDK_SURFACE_DESTROYED (surface) ||
- !SURFACE_IS_TOPLEVEL (surface))
+ if (GDK_SURFACE_DESTROYED (surface))
return GDK_SURFACE_TYPE_HINT_NORMAL;
type = GDK_SURFACE_TYPE_HINT_NORMAL;
gdk_x11_surface_set_modal_hint (GdkSurface *surface,
gboolean modal)
{
- if (GDK_SURFACE_DESTROYED (surface) ||
- !SURFACE_IS_TOPLEVEL (surface))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
surface->modal_hint = modal;
{
GdkToplevelX11 *toplevel;
- if (GDK_SURFACE_DESTROYED (surface) ||
- !SURFACE_IS_TOPLEVEL (surface))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
toplevel = _gdk_x11_surface_get_toplevel (surface);
{
GdkToplevelX11 *toplevel;
- if (GDK_SURFACE_DESTROYED (surface) ||
- !SURFACE_IS_TOPLEVEL (surface))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
toplevel = _gdk_x11_surface_get_toplevel (surface);
{
GdkToplevelX11 *toplevel;
- if (GDK_SURFACE_DESTROYED (surface) ||
- !SURFACE_IS_TOPLEVEL (surface))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
toplevel = _gdk_x11_surface_get_toplevel (surface);
XSizeHints size_hints;
GdkToplevelX11 *toplevel;
- if (GDK_SURFACE_DESTROYED (surface) ||
- !SURFACE_IS_TOPLEVEL (surface))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
toplevel = _gdk_x11_surface_get_toplevel (surface);
*geom_mask = 0;
- if (GDK_SURFACE_DESTROYED (surface) ||
- !SURFACE_IS_TOPLEVEL (surface))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
impl = GDK_X11_SURFACE (surface);
g_return_if_fail (title != NULL);
- if (GDK_SURFACE_DESTROYED (surface) ||
- !SURFACE_IS_TOPLEVEL (surface))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
display = gdk_surface_get_display (surface);
display = gdk_surface_get_display (surface);
- if (GDK_SURFACE_DESTROYED (surface) ||
- !SURFACE_IS_TOPLEVEL (surface))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
if (startup_id)
gdk_x11_surface_set_transient_for (GdkSurface *surface,
GdkSurface *parent)
{
- if (GDK_SURFACE_DESTROYED (surface) ||
- !SURFACE_IS_TOPLEVEL (surface))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
/* XSetTransientForHint() doesn't allow unsetting, so do it manually */
{
surface->accept_focus = accept_focus;
- if (!GDK_SURFACE_DESTROYED (surface) &&
- SURFACE_IS_TOPLEVEL (surface))
+ if (!GDK_SURFACE_DESTROYED (surface))
update_wm_hints (surface, FALSE);
}
}
{
surface->focus_on_map = focus_on_map;
- if ((!GDK_SURFACE_DESTROYED (surface)) &&
- (!surface->focus_on_map) &&
- SURFACE_IS_TOPLEVEL (surface))
+ if (!GDK_SURFACE_DESTROYED (surface) &&
+ !surface->focus_on_map)
gdk_x11_surface_set_user_time (surface, 0);
}
}
glong timestamp_long = (glong)timestamp;
Window xid;
- if (GDK_SURFACE_DESTROYED (surface) ||
- !SURFACE_IS_TOPLEVEL (surface))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
display = gdk_surface_get_display (surface);
{
GdkDisplay *display;
- if (!SURFACE_IS_TOPLEVEL (surface))
- return;
-
display = gdk_surface_get_display (surface);
if (value != NULL)
GdkDisplay *display;
gint i, n;
- if (GDK_SURFACE_DESTROYED (surface) ||
- !SURFACE_IS_TOPLEVEL (surface))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
display = gdk_surface_get_display (surface);
{
GdkDisplay *display;
- if (GDK_SURFACE_DESTROYED (surface) ||
- !SURFACE_IS_TOPLEVEL (surface))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
display = gdk_surface_get_display (surface);
static void
gdk_x11_surface_iconify (GdkSurface *surface)
{
- if (GDK_SURFACE_DESTROYED (surface) ||
- !SURFACE_IS_TOPLEVEL (surface))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
if (GDK_SURFACE_IS_MAPPED (surface))
static void
gdk_x11_surface_deiconify (GdkSurface *surface)
{
- if (GDK_SURFACE_DESTROYED (surface) ||
- !SURFACE_IS_TOPLEVEL (surface))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
if (GDK_SURFACE_IS_MAPPED (surface))
static void
gdk_x11_surface_stick (GdkSurface *surface)
{
- if (GDK_SURFACE_DESTROYED (surface) ||
- !SURFACE_IS_TOPLEVEL (surface))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
if (GDK_SURFACE_IS_MAPPED (surface))
static void
gdk_x11_surface_unstick (GdkSurface *surface)
{
- if (GDK_SURFACE_DESTROYED (surface) ||
- !SURFACE_IS_TOPLEVEL (surface))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
if (GDK_SURFACE_IS_MAPPED (surface))
static void
gdk_x11_surface_maximize (GdkSurface *surface)
{
- if (GDK_SURFACE_DESTROYED (surface) ||
- !SURFACE_IS_TOPLEVEL (surface))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
if (GDK_SURFACE_IS_MAPPED (surface))
static void
gdk_x11_surface_unmaximize (GdkSurface *surface)
{
- if (GDK_SURFACE_DESTROYED (surface) ||
- !SURFACE_IS_TOPLEVEL (surface))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
if (GDK_SURFACE_IS_MAPPED (surface))
static void
gdk_x11_surface_apply_fullscreen_mode (GdkSurface *surface)
{
- if (GDK_SURFACE_DESTROYED (surface) ||
- !SURFACE_IS_TOPLEVEL (surface))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
/* _NET_WM_FULLSCREEN_MONITORS gives an indication to the window manager as
static void
gdk_x11_surface_fullscreen (GdkSurface *surface)
{
- if (GDK_SURFACE_DESTROYED (surface) ||
- !SURFACE_IS_TOPLEVEL (surface))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
if (GDK_SURFACE_IS_MAPPED (surface))
{
GdkRectangle geom;
- if (GDK_SURFACE_DESTROYED (surface) ||
- !SURFACE_IS_TOPLEVEL (surface))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
gdk_monitor_get_geometry (monitor, &geom);
static void
gdk_x11_surface_unfullscreen (GdkSurface *surface)
{
- if (GDK_SURFACE_DESTROYED (surface) ||
- !SURFACE_IS_TOPLEVEL (surface))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
if (GDK_SURFACE_IS_MAPPED (surface))
{
g_return_if_fail (GDK_IS_SURFACE (surface));
- if (GDK_SURFACE_DESTROYED (surface) ||
- !SURFACE_IS_TOPLEVEL (surface))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
if (GDK_SURFACE_IS_MAPPED (surface))
{
g_return_if_fail (GDK_IS_SURFACE (surface));
- if (GDK_SURFACE_DESTROYED (surface) ||
- !SURFACE_IS_TOPLEVEL (surface))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
if (GDK_SURFACE_IS_MAPPED (surface))
{
GdkToplevelX11 *toplevel;
- if (GDK_SURFACE_DESTROYED (surface) ||
- !SURFACE_IS_TOPLEVEL (surface))
+ if (GDK_SURFACE_DESTROYED (surface))
return NULL;
toplevel = _gdk_x11_surface_get_toplevel (surface);
g_return_if_fail (leader == NULL || GDK_IS_SURFACE (leader));
if (GDK_SURFACE_DESTROYED (surface) ||
- (leader != NULL && GDK_SURFACE_DESTROYED (leader)) ||
- !SURFACE_IS_TOPLEVEL (surface))
+ (leader != NULL && GDK_SURFACE_DESTROYED (leader)))
return;
toplevel = _gdk_x11_surface_get_toplevel (surface);
{
MotifWmHints hints;
- if (GDK_SURFACE_DESTROYED (surface) ||
- !SURFACE_IS_TOPLEVEL (surface))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
/* initialize to zero to avoid writing uninitialized data to socket */
MotifWmHints *hints;
gboolean result = FALSE;
- if (GDK_SURFACE_DESTROYED (surface) ||
- !SURFACE_IS_TOPLEVEL (surface))
+ if (GDK_SURFACE_DESTROYED (surface))
return FALSE;
hints = gdk_surface_get_mwm_hints (surface);
g_return_if_fail (GDK_IS_SURFACE (surface));
- if (GDK_SURFACE_DESTROYED (surface) ||
- !SURFACE_IS_TOPLEVEL (surface))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
/* initialize to zero to avoid writing uninitialized data to socket */
{
int root_x, root_y;
- if (GDK_SURFACE_DESTROYED (surface) ||
- !SURFACE_IS_TOPLEVEL (surface))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
gdk_x11_surface_get_root_coords (surface, x, y, &root_x, &root_y);
int root_x, root_y;
gint direction;
- if (GDK_SURFACE_DESTROYED (surface) || !SURFACE_IS_TOPLEVEL (surface))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
if (button == 0)
g_return_if_fail (GDK_IS_SURFACE (surface));
- if (GDK_SURFACE_DESTROYED (surface) ||
- !SURFACE_IS_TOPLEVEL (surface))
+ if (GDK_SURFACE_DESTROYED (surface))
return;
display = gdk_surface_get_display (surface);